package day14.homework02.test01;

/**
 * @author Xiao
 * @date 2021/8/7
 */
public class Test01 {
    /**
     * 1. 用lock锁解决线程安全
     */
    public static void main(String[] args) {
        Ticket t0 = new Ticket();
        Thread t1 = new Thread(t0);
        Thread t2 = new Thread(t0);
        Thread t3 = new Thread(t0);
        t1.setName("窗口1");
        t2.setName("窗口2");
        t3.setName("窗口3");
        t1.start();
        t2.start();
        t3.start();
    }
}
